#[macro_export]
macro_rules! sname {
    ($id: ident) => {
        $id.with(|n| godot::builtin::StringName::clone(&n))
    };
    ($s: expr) => {{
        use godot::prelude::StringName;
        use std::cell::LazyCell;

        thread_local! {
            static KEY: LazyCell<StringName> = const { LazyCell::new(|| StringName::from($s)) };
        }

        KEY.with(|n| StringName::clone(&n))
    }};
}

#[macro_export]
macro_rules! sname_local {
    {} => {};
    { static $n: ident = $s: expr; $($rest:tt)* } => {
        thread_local! {
            static $n: std::cell::LazyCell<StringName> = const { std::cell::LazyCell::new(|| StringName::from($s)) };
        }
        sname_local!{$($rest)*}
    };
    { static $n: ident = $s: expr } => {
        thread_local! {
            static $n: std::cell::LazyCell<StringName> = const { std::cell::LazyCell::new(|| StringName::from($s)) };
        }
    };
}